package scrum.client.tasks;

import java.util.List;

import scrum.client.project.Requirement;
import scrum.client.sprint.PullNextRequirementFilteredAction;
import scrum.client.sprint.Sprint;

public class WhiteboardGroupFilteredWidget extends WhiteboardWidget {

	@Override
	protected PullNextRequirementFilteredAction getPullNextReqAction() {
		return new PullNextRequirementFilteredAction(getCurrentProjectSprint());
	}

	@Override
	protected List<Requirement> postProcessRequirements(List<Requirement> requirements) {
		// Filter by group!
		return getDao().filterRequirements(getCurrentUser(), getCurrentProject(), requirements);
	}

	@Override
	protected Sprint getCurrentProjectSprint() {
		Sprint currSprint = getCurrentSprint();
		currSprint.setRequirementsFilterActive(true);
		return currSprint;
	}
}
